package com.fw.ui.view.settings.usercontrol.parentmerchant;

import static org.springframework.beans.factory.config.BeanDefinition.SCOPE_PROTOTYPE;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;

import com.fw.service.bean.EntryBean;
import com.fw.service.bean.SearchCriteriaBean;
import com.fw.service.bean.SearchResultBean;
import com.fw.service.formvalidator.FormValidatorService;
import com.fw.service.merchantprofile.bean.MerchantProfileBean;
import com.fw.service.merchantprofile.bean.SearchMerchantProfileBean;
import com.fw.service.parentmerchant.bean.ParentMerchantBean;
import com.fw.ui.bao.MasterDataBAO;
import com.fw.ui.bao.MerchantProfileBAO;
import com.fw.ui.bao.MessageBAO;
import com.fw.ui.bao.ParentMerchantBAO;
import com.fw.ui.bao.PropertyBAO;
import com.fw.ui.bean.parentmerchant.SearchMerchantProfileTableItemBean;
import com.fw.ui.core.ViewDescription;
import com.fw.ui.util.UICommonUtils;
import com.fw.ui.util.VaadinApplicationObjectSupport;
import com.fw.ui.util.validator.StringLengthValidator;
import com.fw.ui.view.AbstractView;
import com.fw.ui.view.common.TablePanel;
import com.fw.ui.view.common.util.TableHeaderProperty;
import com.fw.ui.view.settings.usercontrol.parentmerchant.event.CreateParentMerchantCancelButtonClickListener;
import com.fw.ui.view.settings.usercontrol.parentmerchant.event.CreateParentMerchantClearButtonClickListener;
import com.fw.ui.view.settings.usercontrol.parentmerchant.event.CreateParentMerchantSaveButtonClickListener;
import com.fw.ui.view.settings.usercontrol.parentmerchant.event.CreateParentMerchantSearchMerchantProfileClearButtonClickListener;
import com.fw.ui.view.settings.usercontrol.parentmerchant.event.CreateParentMerchantSearchMerchantProfileSearchButtonClickListener;
import com.fw.ui.view.settings.usercontrol.parentmerchant.event.CreateParentMerchantSearchMerchantProfileTableAddButtonClickListener;
import com.fw.ui.view.settings.usercontrol.parentmerchant.event.CreateParentMerchantSearchMerchantProfileTablePageButtonClickListener;
import com.fw.ui.view.settings.usercontrol.parentmerchant.event.CreateParentMerchantSearchMerchantProfileTableSizeValueChangeListener;
import com.fw.ui.view.settings.usercontrol.parentmerchant.event.CreateParentMerchantSelectedMerchantProfileTablePageButtonClickListener;
import com.fw.ui.view.settings.usercontrol.parentmerchant.event.CreateParentMerchantSelectedMerchantProfileTableRemoveButtonClickListener;
import com.fw.ui.view.settings.usercontrol.parentmerchant.event.CreateParentMerchantSelectedMerchantProfileTableSizeValueChangeListener;
import com.vaadin.data.util.BeanItem;
import com.vaadin.data.validator.RegexpValidator;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.Table.Align;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;

@org.springframework.stereotype.Component
@Scope(SCOPE_PROTOTYPE)
@ViewDescription(name = "settings-user-control-parentmerchant-new", path = "/settings/user-control/parentmerchant-new")
public class CreateParentMerchantView extends AbstractView {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @Autowired
    protected transient VaadinApplicationObjectSupport app;

    @Autowired
    private MasterDataBAO masterDataBAO;
    @Autowired
    private PropertyBAO propertyBAO;
    @Autowired
    private MessageBAO messageBAO;
    @Autowired
    private MerchantProfileBAO merchantProfileBAO;
    @Autowired
    private ParentMerchantBAO parentMerchantBAO;

    private Map<String, String> merchantStatusMap = new HashMap<String, String>();
    @SuppressWarnings("rawtypes")
    private Map<Long, BeanItem> selectedBeanItemMap = new LinkedHashMap<Long, BeanItem>();

    /**
     * BEAN
     */
    private ParentMerchantBean parentMerchantBean = new ParentMerchantBean();
    private SearchCriteriaBean<SearchMerchantProfileBean> searchCriteriaBean = new SearchCriteriaBean<SearchMerchantProfileBean>();

    /**
     * EVENT
     */
    @Autowired
    private CreateParentMerchantSearchMerchantProfileSearchButtonClickListener createParentMerchantSearchMerchantProfileSearchButtonClickListener;
    @Autowired
    private CreateParentMerchantSearchMerchantProfileClearButtonClickListener createParentMerchantSearchMerchantProfileClearButtonClickListener;

    @Autowired
    private CreateParentMerchantSearchMerchantProfileTableAddButtonClickListener createParentMerchantSearchMerchantProfileTableAddButtonClickListener;
    @Autowired
    private CreateParentMerchantSelectedMerchantProfileTableRemoveButtonClickListener createParentMerchantSelectedMerchantProfileTableRemoveButtonClickListener;

    @Autowired
    private CreateParentMerchantSearchMerchantProfileTablePageButtonClickListener createParentMerchantSearchMerchantProfileTablePageButtonClickListener;
    @Autowired
    private CreateParentMerchantSearchMerchantProfileTableSizeValueChangeListener createParentMerchantSearchMerchantProfileTableSizeValueChangeListener;

    @Autowired
    private CreateParentMerchantSelectedMerchantProfileTablePageButtonClickListener createParentMerchantSelectedMerchantProfileTablePageButtonClickListener;
    @Autowired
    private CreateParentMerchantSelectedMerchantProfileTableSizeValueChangeListener createParentMerchantSelectedMerchantProfileTableSizeValueChangeListener;

    @Autowired
    private CreateParentMerchantClearButtonClickListener createParentMerchantClearButtonClickListener;
    @Autowired
    private CreateParentMerchantSaveButtonClickListener createParentMerchantSaveButtonClickListener;
    @Autowired
    private CreateParentMerchantCancelButtonClickListener createParentMerchantCancelButtonClickListener;

    /**
     * COMPONENT
     */
    private Panel createParentMerchantPanel = new Panel();

    private Panel createParentMerchantProfilePanel = new Panel();
    private Panel createParentMerchantContactPersonPanel = new Panel();
    private Panel createMerchantMemberPanel = new Panel();

    private GridLayout gridParentMerchantPanelLayout = new GridLayout(4, 3);
    private GridLayout gridParentMerchantProfileLayout = new GridLayout(4, 4);
    private GridLayout gridParentMerchantContactPersonLayout = new GridLayout(4, 5);
    private GridLayout gridParentMerchantMemberLayout = new GridLayout(1, 3);
    private GridLayout gridParentMerchantSearchLayout = new GridLayout(8, 5);

    private Label lblParentMerchantID = new Label();
    private Label lblParentMerchantName = new Label();
    private Label lblBusinessAddress = new Label();
    private Label lblParentStatus = new Label();
    private Label lblTitle = new Label();
    private Label lblFirstName = new Label();
    private Label lblLastName = new Label();
    private Label lblTelephoneNumber = new Label();
    private Label lblEmailAddress = new Label();

    private TextField txtParentMerchantID = new TextField();
    private TextField txtParentMerchantName = new TextField();
    private TextArea txtBusinessAddress = new TextArea();
    private ComboBox cbbParentStatus = new ComboBox();
    private ComboBox cbbTitle = new ComboBox();
    private TextField txtFirstName = new TextField();
    private TextField txtLastName = new TextField();
    private TextField txtTelephoneNumber = new TextField();
    private TextField txtEmailAddress = new TextField();

    private Label lblParentMerchantIDValidateMessage = new Label("", ContentMode.HTML);
    private Label lblParentMerchantNameValidateMessage = new Label("", ContentMode.HTML);
    private Label lblBusinessAddressValidateMessage = new Label("", ContentMode.HTML);
    private Label lblParentStatusValidateMessage = new Label("", ContentMode.HTML);
    private Label lblTitleValidateMessage = new Label("", ContentMode.HTML);
    private Label lblFirstNameValidateMessage = new Label("", ContentMode.HTML);
    private Label lblLastNameValidateMessage = new Label("", ContentMode.HTML);
    private Label lblTelephoneNumberValidateMessage = new Label("", ContentMode.HTML);
    private Label lblEmailAddressValidateMessage = new Label("", ContentMode.HTML);

    private Label lblMerchantID = new Label();
    private Label lblMerchantCompanyName = new Label();
    private Label lblMerchantUrl = new Label();
    private Label lblMerchantContactPerson = new Label();
    private Label lblMerchantStatus = new Label();

    private TextField txtMerchantID = new TextField();
    private TextField txtMerchantCompanyName = new TextField();
    private TextField txtMerchantUrl = new TextField();
    private TextField txtMerchantContactPerson = new TextField();
    private ComboBox cbbMerchantStatus = new ComboBox();

    private Button btnMerchantSearch = new Button();
    private Button btnMerchantClear = new Button();

    @Autowired
    protected TablePanel tableMerchantPanel;
    private TableHeaderProperty hCommand = new TableHeaderProperty();
    private TableHeaderProperty hNo = new TableHeaderProperty();
    private TableHeaderProperty hMerchantID = new TableHeaderProperty();
    private TableHeaderProperty hMerchantCompanyName = new TableHeaderProperty();
    private TableHeaderProperty hMerchantUrl = new TableHeaderProperty();
    private TableHeaderProperty hMerchantContactPerson = new TableHeaderProperty();
    private TableHeaderProperty hMerchantStatus = new TableHeaderProperty();
    private TableHeaderProperty hId = new TableHeaderProperty();

    @Autowired
    protected TablePanel tableMerchantSelectedPanel;
    private TableHeaderProperty hCommandSelected = new TableHeaderProperty();
    private TableHeaderProperty hNoSelected = new TableHeaderProperty();
    private TableHeaderProperty hMerchantIDSelected = new TableHeaderProperty();
    private TableHeaderProperty hMerchantCompanyNameSelected = new TableHeaderProperty();
    private TableHeaderProperty hMerchantUrlSelected = new TableHeaderProperty();
    private TableHeaderProperty hMerchantContactPersonSelected = new TableHeaderProperty();
    private TableHeaderProperty hMerchantStatusSelected = new TableHeaderProperty();
    private TableHeaderProperty hIdSelected = new TableHeaderProperty();

    private Button btnSave = new Button();
    private Button btnClear = new Button();
    private Button btnCancel = new Button();

    private List<Button> tableAddButtons = new ArrayList<Button>();
    private List<Button> tableRemoveButtons = new ArrayList<Button>();

    @Override
    public void updateStrings() {

	this.createParentMerchantPanel.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.panel.createParentMerchantPanel"));
	this.createParentMerchantProfilePanel
		.setCaption(this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.panel.createParentMerchantProfilePanel"));
	this.createParentMerchantContactPersonPanel
		.setCaption(this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.panel.createParentMerchantContactPersonPanel"));
	this.createMerchantMemberPanel.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.panel.createMerchantMemberPanel"));
	this.tableMerchantPanel.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.panel.searchMerchantMember"));
	this.tableMerchantSelectedPanel.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.panel.parentMerchantMember"));

	this.lblParentMerchantID.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.parentMerchantID"));
	this.lblParentMerchantName.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.parentMerchantName"));
	this.lblBusinessAddress.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.businessAddress"));
	this.lblParentStatus.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.parentStatus"));
	this.lblTitle.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.title"));
	this.lblFirstName.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.firstName"));
	this.lblLastName.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.lastName"));
	this.lblTelephoneNumber.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.telephoneNumber"));
	this.lblEmailAddress.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.emailAddress"));

	this.lblMerchantID.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.merchantID"));
	this.lblMerchantCompanyName.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.merchantCompanyName"));
	this.lblMerchantUrl.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.merchantUrl"));
	this.lblMerchantContactPerson.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.merchantContactPerson"));
	this.lblMerchantStatus.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.label.merchantStatus"));

	this.btnMerchantSearch.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.button.merchantSearch"));
	this.btnMerchantClear.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.button.merchantClear"));

	this.hCommand.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.command"));
	this.hNo.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.no"));
	this.hMerchantID.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.merchantID"));
	this.hMerchantCompanyName.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.merchantCompnayName"));
	this.hMerchantUrl.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.merchantUrl"));
	this.hMerchantContactPerson.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.merchantContactPerson"));
	this.hMerchantStatus.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.merchantStatus"));

	tableMerchantPanel.setTableColumnHeader(this.hCommand.getColumnId(), this.hCommand.getColumnName());
	tableMerchantPanel.setTableColumnHeader(this.hNo.getColumnId(), this.hNo.getColumnName());
	tableMerchantPanel.setTableColumnHeader(this.hMerchantID.getColumnId(), this.hMerchantID.getColumnName());
	tableMerchantPanel.setTableColumnHeader(this.hMerchantCompanyName.getColumnId(), this.hMerchantCompanyName.getColumnName());
	tableMerchantPanel.setTableColumnHeader(this.hMerchantUrl.getColumnId(), this.hMerchantUrl.getColumnName());
	tableMerchantPanel.setTableColumnHeader(this.hMerchantContactPerson.getColumnId(), this.hMerchantContactPerson.getColumnName());
	tableMerchantPanel.setTableColumnHeader(this.hMerchantStatus.getColumnId(), this.hMerchantStatus.getColumnName());

	this.hCommandSelected.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.command"));
	this.hNoSelected.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.no"));
	this.hMerchantIDSelected.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.merchantID"));
	this.hMerchantCompanyNameSelected.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.merchantCompnayName"));
	this.hMerchantUrlSelected.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.merchantUrl"));
	this.hMerchantContactPersonSelected.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.merchantContactPerson"));
	this.hMerchantStatusSelected.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.header.merchantStatus"));

	tableMerchantSelectedPanel.setTableColumnHeader(this.hCommandSelected.getColumnId(), this.hCommandSelected.getColumnName());
	tableMerchantSelectedPanel.setTableColumnHeader(this.hNoSelected.getColumnId(), this.hNoSelected.getColumnName());
	tableMerchantSelectedPanel.setTableColumnHeader(this.hMerchantIDSelected.getColumnId(), this.hMerchantIDSelected.getColumnName());
	tableMerchantSelectedPanel.setTableColumnHeader(this.hMerchantCompanyNameSelected.getColumnId(),
		this.hMerchantCompanyNameSelected.getColumnName());
	tableMerchantSelectedPanel.setTableColumnHeader(this.hMerchantUrlSelected.getColumnId(), this.hMerchantUrlSelected.getColumnName());
	tableMerchantSelectedPanel.setTableColumnHeader(this.hMerchantContactPersonSelected.getColumnId(),
		this.hMerchantContactPersonSelected.getColumnName());
	tableMerchantSelectedPanel.setTableColumnHeader(this.hMerchantStatusSelected.getColumnId(),
		this.hMerchantStatusSelected.getColumnName());

	this.btnSave.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.button.save"));
	this.btnClear.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.button.clear"));
	this.btnCancel.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.button.cancel"));
    }

    @Override
    public void init() {
	setSizeFull();

	createParentMerchantPanel.setSizeFull();
	createParentMerchantPanel.setId("createParentMerchantPanel");

	createParentMerchantProfilePanel.setSizeFull();
	createParentMerchantProfilePanel.setId("createParentMerchantProfilePanel");

	createParentMerchantContactPersonPanel.setSizeFull();
	createParentMerchantContactPersonPanel.setId("createParentMerchantContactPersonPanel");

	createMerchantMemberPanel.setSizeFull();
	createMerchantMemberPanel.setId("createMerchantMemberPanel");

	lblParentMerchantIDValidateMessage.addStyleName("validate-error");
	lblParentMerchantNameValidateMessage.addStyleName("validate-error");
	lblBusinessAddressValidateMessage.addStyleName("validate-error");
	lblParentStatusValidateMessage.addStyleName("validate-error");
	lblTitleValidateMessage.addStyleName("validate-error");
	lblFirstNameValidateMessage.addStyleName("validate-error");
	lblLastNameValidateMessage.addStyleName("validate-error");
	lblTelephoneNumberValidateMessage.addStyleName("validate-error");
	lblEmailAddressValidateMessage.addStyleName("validate-error");

	lblParentMerchantIDValidateMessage.setVisible(false);
	lblParentMerchantNameValidateMessage.setVisible(false);
	lblBusinessAddressValidateMessage.setVisible(false);
	lblParentStatusValidateMessage.setVisible(false);
	lblTitleValidateMessage.setVisible(false);
	lblFirstNameValidateMessage.setVisible(false);
	lblLastNameValidateMessage.setVisible(false);
	lblTelephoneNumberValidateMessage.setVisible(false);
	lblEmailAddressValidateMessage.setVisible(false);

	lblParentMerchantIDValidateMessage.setId("lblParentMerchantIDValidateMessage" + UICommonUtils.INCLUDE_VALUE_COMPONENT_PREFIX);
	lblParentMerchantNameValidateMessage.setId("lblParentMerchantNameValidateMessage" + UICommonUtils.INCLUDE_VALUE_COMPONENT_PREFIX);
	lblBusinessAddressValidateMessage.setId("lblBusinessAddressValidateMessage" + UICommonUtils.INCLUDE_VALUE_COMPONENT_PREFIX);
	lblParentStatusValidateMessage.setId("lblParentStatusValidateMessage" + UICommonUtils.INCLUDE_VALUE_COMPONENT_PREFIX);
	lblTitleValidateMessage.setId("lblTitleValidateMessage" + UICommonUtils.INCLUDE_VALUE_COMPONENT_PREFIX);
	lblFirstNameValidateMessage.setId("lblFirstNameValidateMessage" + UICommonUtils.INCLUDE_VALUE_COMPONENT_PREFIX);
	lblLastNameValidateMessage.setId("lblLastNameValidateMessage" + UICommonUtils.INCLUDE_VALUE_COMPONENT_PREFIX);
	lblTelephoneNumberValidateMessage.setId("lblTelephoneNumberValidateMessage" + UICommonUtils.INCLUDE_VALUE_COMPONENT_PREFIX);
	lblEmailAddressValidateMessage.setId("lblEmailAddressValidateMessage" + UICommonUtils.INCLUDE_VALUE_COMPONENT_PREFIX);

	String labelWidth = "150px";
	lblParentMerchantID.setWidth(labelWidth);
	lblParentMerchantName.setWidth(labelWidth);
	lblBusinessAddress.setWidth(labelWidth);
	lblParentStatus.setWidth(labelWidth);
	lblTitle.setWidth(labelWidth);
	lblFirstName.setWidth(labelWidth);
	lblLastName.setWidth(labelWidth);
	lblTelephoneNumber.setWidth(labelWidth);
	lblEmailAddress.setWidth(labelWidth);

	lblMerchantID.setWidth(labelWidth);
	lblMerchantCompanyName.setWidth(labelWidth);
	lblMerchantUrl.setWidth(labelWidth);
	lblMerchantContactPerson.setWidth(labelWidth);
	lblMerchantStatus.setWidth(labelWidth);

	String inputWidth = "200px";
	txtParentMerchantID.setWidth(inputWidth);
	txtParentMerchantName.setWidth(inputWidth);
	txtBusinessAddress.setWidth(inputWidth);
	cbbParentStatus.setWidth(inputWidth);
	cbbTitle.setWidth(inputWidth);
	txtFirstName.setWidth(inputWidth);
	txtLastName.setWidth(inputWidth);
	txtTelephoneNumber.setWidth(inputWidth);
	txtEmailAddress.setWidth(inputWidth);

	txtMerchantID.setWidth(inputWidth);
	txtMerchantCompanyName.setWidth(inputWidth);
	txtMerchantUrl.setWidth(inputWidth);
	txtMerchantContactPerson.setWidth(inputWidth);
	cbbMerchantStatus.setWidth(inputWidth);

	createParentMerchantPanel.setContent(gridParentMerchantPanelLayout);
	gridParentMerchantPanelLayout.setSizeFull();
	gridParentMerchantPanelLayout.setColumnExpandRatio(0, 5);
	gridParentMerchantPanelLayout.setColumnExpandRatio(1, 45);
	gridParentMerchantPanelLayout.setColumnExpandRatio(2, 45);
	gridParentMerchantPanelLayout.setColumnExpandRatio(3, 5);
	gridParentMerchantPanelLayout.addComponent(createParentMerchantProfilePanel, 1, 0);
	gridParentMerchantPanelLayout.setComponentAlignment(createParentMerchantProfilePanel, Alignment.TOP_LEFT);
	gridParentMerchantPanelLayout.addComponent(createParentMerchantContactPersonPanel, 2, 0);
	gridParentMerchantPanelLayout.setComponentAlignment(createParentMerchantContactPersonPanel, Alignment.TOP_LEFT);
	gridParentMerchantPanelLayout.addComponent(createMerchantMemberPanel, 0, 1, 3, 1);
	gridParentMerchantPanelLayout.setComponentAlignment(createMerchantMemberPanel, Alignment.TOP_CENTER);

	createParentMerchantProfilePanel.setContent(gridParentMerchantProfileLayout);
	gridParentMerchantProfileLayout.setSizeFull();
	gridParentMerchantProfileLayout.setSpacing(true);
	gridParentMerchantProfileLayout.setMargin(true);
	gridParentMerchantProfileLayout.setColumnExpandRatio(0, 10);
	gridParentMerchantProfileLayout.setColumnExpandRatio(1, 20);
	gridParentMerchantProfileLayout.setColumnExpandRatio(2, 60);
	gridParentMerchantProfileLayout.setColumnExpandRatio(3, 10);
	gridParentMerchantProfileLayout.setRowExpandRatio(0, 2);
	gridParentMerchantProfileLayout.setRowExpandRatio(1, 1);
	gridParentMerchantProfileLayout.setRowExpandRatio(2, 1);
	gridParentMerchantProfileLayout.setRowExpandRatio(3, 2);
	gridParentMerchantProfileLayout.addComponent(lblParentMerchantID, 1, 0);
	gridParentMerchantProfileLayout.setComponentAlignment(lblParentMerchantID, Alignment.TOP_LEFT);
	VerticalLayout parentMerchantIdLayout = new VerticalLayout();
	parentMerchantIdLayout.addComponent(txtParentMerchantID);
	parentMerchantIdLayout.addComponent(lblParentMerchantIDValidateMessage);
	gridParentMerchantProfileLayout.addComponent(parentMerchantIdLayout, 2, 0);
	gridParentMerchantProfileLayout.setComponentAlignment(parentMerchantIdLayout, Alignment.TOP_LEFT);
	gridParentMerchantProfileLayout.addComponent(lblParentMerchantName, 1, 1);
	gridParentMerchantProfileLayout.setComponentAlignment(lblParentMerchantName, Alignment.TOP_LEFT);
	VerticalLayout parentMerchantNameLayout = new VerticalLayout();
	parentMerchantNameLayout.addComponent(txtParentMerchantName);
	parentMerchantNameLayout.addComponent(lblParentMerchantNameValidateMessage);
	gridParentMerchantProfileLayout.addComponent(parentMerchantNameLayout, 2, 1);
	gridParentMerchantProfileLayout.setComponentAlignment(parentMerchantNameLayout, Alignment.TOP_LEFT);
	gridParentMerchantProfileLayout.addComponent(lblBusinessAddress, 1, 2);
	gridParentMerchantProfileLayout.setComponentAlignment(lblBusinessAddress, Alignment.TOP_LEFT);
	VerticalLayout businessAddressLayout = new VerticalLayout();
	businessAddressLayout.addComponent(txtBusinessAddress);
	businessAddressLayout.addComponent(lblBusinessAddressValidateMessage);
	gridParentMerchantProfileLayout.addComponent(businessAddressLayout, 2, 2);
	gridParentMerchantProfileLayout.setComponentAlignment(businessAddressLayout, Alignment.TOP_LEFT);
	gridParentMerchantProfileLayout.addComponent(lblParentStatus, 1, 3);
	gridParentMerchantProfileLayout.setComponentAlignment(lblParentStatus, Alignment.TOP_LEFT);
	VerticalLayout parentStatusLayout = new VerticalLayout();
	parentStatusLayout.addComponent(cbbParentStatus);
	parentStatusLayout.addComponent(lblParentStatusValidateMessage);
	gridParentMerchantProfileLayout.addComponent(parentStatusLayout, 2, 3);
	gridParentMerchantProfileLayout.setComponentAlignment(parentStatusLayout, Alignment.TOP_LEFT);

	createParentMerchantContactPersonPanel.setContent(gridParentMerchantContactPersonLayout);
	gridParentMerchantContactPersonLayout.setSizeFull();
	gridParentMerchantContactPersonLayout.setSpacing(true);
	gridParentMerchantContactPersonLayout.setMargin(true);
	gridParentMerchantContactPersonLayout.setColumnExpandRatio(0, 10);
	gridParentMerchantContactPersonLayout.setColumnExpandRatio(1, 20);
	gridParentMerchantContactPersonLayout.setColumnExpandRatio(2, 60);
	gridParentMerchantContactPersonLayout.setColumnExpandRatio(3, 10);
	gridParentMerchantContactPersonLayout.setRowExpandRatio(0, 2);
	gridParentMerchantContactPersonLayout.setRowExpandRatio(1, 1);
	gridParentMerchantContactPersonLayout.setRowExpandRatio(2, 1);
	gridParentMerchantContactPersonLayout.setRowExpandRatio(3, 1);
	gridParentMerchantContactPersonLayout.setRowExpandRatio(4, 2);
	gridParentMerchantContactPersonLayout.addComponent(lblTitle, 1, 0);
	gridParentMerchantContactPersonLayout.setComponentAlignment(lblTitle, Alignment.TOP_LEFT);
	VerticalLayout titleLayout = new VerticalLayout();
	titleLayout.addComponent(cbbTitle);
	titleLayout.addComponent(lblTitleValidateMessage);
	gridParentMerchantContactPersonLayout.addComponent(titleLayout, 2, 0);
	gridParentMerchantContactPersonLayout.setComponentAlignment(titleLayout, Alignment.TOP_LEFT);
	gridParentMerchantContactPersonLayout.addComponent(lblFirstName, 1, 1);
	gridParentMerchantContactPersonLayout.setComponentAlignment(lblFirstName, Alignment.TOP_LEFT);
	VerticalLayout firstNameLayout = new VerticalLayout();
	firstNameLayout.addComponent(txtFirstName);
	firstNameLayout.addComponent(lblFirstNameValidateMessage);
	gridParentMerchantContactPersonLayout.addComponent(firstNameLayout, 2, 1);
	gridParentMerchantContactPersonLayout.setComponentAlignment(firstNameLayout, Alignment.TOP_LEFT);
	gridParentMerchantContactPersonLayout.addComponent(lblLastName, 1, 2);
	gridParentMerchantContactPersonLayout.setComponentAlignment(lblLastName, Alignment.TOP_LEFT);
	VerticalLayout lastNameLayout = new VerticalLayout();
	lastNameLayout.addComponent(txtLastName);
	lastNameLayout.addComponent(lblLastNameValidateMessage);
	gridParentMerchantContactPersonLayout.addComponent(lastNameLayout, 2, 2);
	gridParentMerchantContactPersonLayout.setComponentAlignment(lastNameLayout, Alignment.TOP_LEFT);
	gridParentMerchantContactPersonLayout.addComponent(lblTelephoneNumber, 1, 3);
	gridParentMerchantContactPersonLayout.setComponentAlignment(lblTelephoneNumber, Alignment.TOP_LEFT);
	VerticalLayout telephoneNumberLayout = new VerticalLayout();
	telephoneNumberLayout.addComponent(txtTelephoneNumber);
	telephoneNumberLayout.addComponent(lblTelephoneNumberValidateMessage);
	gridParentMerchantContactPersonLayout.addComponent(telephoneNumberLayout, 2, 3);
	gridParentMerchantContactPersonLayout.setComponentAlignment(telephoneNumberLayout, Alignment.TOP_LEFT);
	gridParentMerchantContactPersonLayout.addComponent(lblEmailAddress, 1, 4);
	gridParentMerchantContactPersonLayout.setComponentAlignment(lblEmailAddress, Alignment.TOP_LEFT);
	VerticalLayout emailAddressLayout = new VerticalLayout();
	emailAddressLayout.addComponent(txtEmailAddress);
	emailAddressLayout.addComponent(lblEmailAddressValidateMessage);
	gridParentMerchantContactPersonLayout.addComponent(emailAddressLayout, 2, 4);
	gridParentMerchantContactPersonLayout.setComponentAlignment(emailAddressLayout, Alignment.TOP_LEFT);

	createMerchantMemberPanel.setContent(gridParentMerchantMemberLayout);
	gridParentMerchantMemberLayout.setSizeFull();
	gridParentMerchantMemberLayout.setSpacing(true);
	gridParentMerchantMemberLayout.setMargin(true);

	gridParentMerchantMemberLayout.addComponent(gridParentMerchantSearchLayout, 0, 0);
	gridParentMerchantMemberLayout.setComponentAlignment(gridParentMerchantSearchLayout, Alignment.TOP_CENTER);
	gridParentMerchantSearchLayout.setSizeFull();
	gridParentMerchantSearchLayout.setSpacing(true);
	gridParentMerchantSearchLayout.setColumnExpandRatio(0, 20);
	gridParentMerchantSearchLayout.setColumnExpandRatio(1, 10);
	gridParentMerchantSearchLayout.setColumnExpandRatio(2, 20);
	gridParentMerchantSearchLayout.setColumnExpandRatio(3, 10);
	gridParentMerchantSearchLayout.setColumnExpandRatio(4, 20);
	gridParentMerchantSearchLayout.setColumnExpandRatio(5, 10);
	gridParentMerchantSearchLayout.setColumnExpandRatio(6, 20);
	gridParentMerchantSearchLayout.setColumnExpandRatio(7, 20);
	gridParentMerchantSearchLayout.addComponent(lblMerchantID, 1, 0);
	gridParentMerchantSearchLayout.setComponentAlignment(lblMerchantID, Alignment.TOP_LEFT);
	gridParentMerchantSearchLayout.addComponent(txtMerchantID, 2, 0);
	gridParentMerchantSearchLayout.setComponentAlignment(txtMerchantID, Alignment.TOP_LEFT);
	gridParentMerchantSearchLayout.addComponent(lblMerchantCompanyName, 3, 0);
	gridParentMerchantSearchLayout.setComponentAlignment(lblMerchantCompanyName, Alignment.TOP_LEFT);
	gridParentMerchantSearchLayout.addComponent(txtMerchantCompanyName, 4, 0);
	gridParentMerchantSearchLayout.setComponentAlignment(txtMerchantCompanyName, Alignment.TOP_LEFT);
	gridParentMerchantSearchLayout.addComponent(lblMerchantUrl, 5, 0);
	gridParentMerchantSearchLayout.setComponentAlignment(lblMerchantUrl, Alignment.TOP_LEFT);
	gridParentMerchantSearchLayout.addComponent(txtMerchantUrl, 6, 0);
	gridParentMerchantSearchLayout.setComponentAlignment(txtMerchantUrl, Alignment.TOP_LEFT);
	gridParentMerchantSearchLayout.addComponent(lblMerchantContactPerson, 1, 1);
	gridParentMerchantSearchLayout.setComponentAlignment(lblMerchantContactPerson, Alignment.TOP_LEFT);
	gridParentMerchantSearchLayout.addComponent(txtMerchantContactPerson, 2, 1);
	gridParentMerchantSearchLayout.setComponentAlignment(txtMerchantContactPerson, Alignment.TOP_LEFT);
	gridParentMerchantSearchLayout.addComponent(lblMerchantStatus, 3, 1);
	gridParentMerchantSearchLayout.setComponentAlignment(lblMerchantStatus, Alignment.TOP_LEFT);
	gridParentMerchantSearchLayout.addComponent(cbbMerchantStatus, 4, 1);
	gridParentMerchantSearchLayout.setComponentAlignment(cbbMerchantStatus, Alignment.TOP_LEFT);
	HorizontalLayout searchCommandLayout = new HorizontalLayout();
	searchCommandLayout.setSizeUndefined();
	searchCommandLayout.setSpacing(true);
	btnMerchantSearch.addStyleName("button-blue");
	btnMerchantClear.addStyleName("button-green");
	btnMerchantSearch.setDisableOnClick(true);
	btnMerchantClear.setDisableOnClick(true);
	btnMerchantSearch.setWidth("70px");
	btnMerchantClear.setWidth("70px");
	searchCommandLayout.addComponent(btnMerchantSearch);
	searchCommandLayout.addComponent(btnMerchantClear);
	gridParentMerchantSearchLayout.addComponent(searchCommandLayout, 0, 2, 7, 2);
	gridParentMerchantSearchLayout.setComponentAlignment(searchCommandLayout, Alignment.MIDDLE_CENTER);

	hCommand.setColumnId("commandLayout");
	hCommand.setType(HorizontalLayout.class);
	hCommand.setAlignment(Align.CENTER);
	hCommand.setDefaultValue(null);
	hCommand.setIconResource(null);
	hCommand.setWidth(80);
	hCommand.setOrder(1);

	hNo.setColumnId("seqNo");
	hNo.setType(Integer.class);
	hNo.setAlignment(Align.CENTER);
	hNo.setDefaultValue(null);
	hNo.setIconResource(null);
	hNo.setWidth(50);
	hNo.setOrder(2);

	hMerchantID.setColumnId("merchantID");
	hMerchantID.setType(String.class);
	hMerchantID.setAlignment(Align.LEFT);
	hMerchantID.setDefaultValue(null);
	hMerchantID.setIconResource(null);
	hMerchantID.setWidth(100);
	hMerchantID.setOrder(3);

	hMerchantCompanyName.setColumnId("merchantCompnayName");
	hMerchantCompanyName.setType(String.class);
	hMerchantCompanyName.setAlignment(Align.LEFT);
	hMerchantCompanyName.setDefaultValue(null);
	hMerchantCompanyName.setIconResource(null);
	hMerchantCompanyName.setWidth(300);
	hMerchantCompanyName.setOrder(4);

	hMerchantUrl.setColumnId("merchantUrl");
	hMerchantUrl.setType(String.class);
	hMerchantUrl.setAlignment(Align.LEFT);
	hMerchantUrl.setDefaultValue(null);
	hMerchantUrl.setIconResource(null);
	hMerchantUrl.setOrder(5);

	hMerchantContactPerson.setColumnId("merchantContactPerson");
	hMerchantContactPerson.setType(String.class);
	hMerchantContactPerson.setAlignment(Align.LEFT);
	hMerchantContactPerson.setDefaultValue(null);
	hMerchantContactPerson.setIconResource(null);
	hMerchantContactPerson.setWidth(200);
	hMerchantContactPerson.setOrder(6);

	hMerchantStatus.setColumnId("merchantStatus");
	hMerchantStatus.setType(String.class);
	hMerchantStatus.setAlignment(Align.CENTER);
	hMerchantStatus.setDefaultValue(null);
	hMerchantStatus.setIconResource(null);
	hMerchantStatus.setWidth(100);
	hMerchantStatus.setOrder(7);

	hId.setColumnId("id");
	hId.setType(Long.class);
	hId.setVisible(false);
	hId.setOrder(8);

	List<TableHeaderProperty> headerProperties = new ArrayList<TableHeaderProperty>();
	headerProperties.add(hCommand);
	headerProperties.add(hNo);
	headerProperties.add(hMerchantID);
	headerProperties.add(hMerchantCompanyName);
	headerProperties.add(hMerchantUrl);
	headerProperties.add(hMerchantContactPerson);
	headerProperties.add(hMerchantStatus);
	headerProperties.add(hId);

	tableMerchantPanel.setTableBeanContainerColumnHeader(headerProperties, SearchMerchantProfileTableItemBean.class);
	tableMerchantPanel.setRowIndexVisiblePageNumber();
	tableMerchantPanel.setTableSelect(false);
	tableMerchantPanel.setAllowSortRecord(false);
	tableMerchantPanel.setEnableTableSorting(false);
	tableMerchantPanel.setTableColumnReordering(false);
	tableMerchantPanel.createControlTablePageNumber();

	gridParentMerchantMemberLayout.addComponent(tableMerchantPanel, 0, 1);
	gridParentMerchantMemberLayout.setComponentAlignment(tableMerchantPanel, Alignment.TOP_CENTER);

	hCommandSelected.setColumnId("commandLayout");
	hCommandSelected.setType(HorizontalLayout.class);
	hCommandSelected.setAlignment(Align.CENTER);
	hCommandSelected.setDefaultValue(null);
	hCommandSelected.setIconResource(null);
	hCommandSelected.setWidth(80);
	hCommandSelected.setOrder(1);

	hNoSelected.setColumnId("seqNo");
	hNoSelected.setType(Integer.class);
	hNoSelected.setAlignment(Align.CENTER);
	hNoSelected.setDefaultValue(null);
	hNoSelected.setIconResource(null);
	hNoSelected.setWidth(50);
	hNoSelected.setOrder(2);

	hMerchantIDSelected.setColumnId("merchantID");
	hMerchantIDSelected.setType(String.class);
	hMerchantIDSelected.setAlignment(Align.LEFT);
	hMerchantIDSelected.setDefaultValue(null);
	hMerchantIDSelected.setIconResource(null);
	hMerchantIDSelected.setWidth(100);
	hMerchantIDSelected.setOrder(3);

	hMerchantCompanyNameSelected.setColumnId("merchantCompnayName");
	hMerchantCompanyNameSelected.setType(String.class);
	hMerchantCompanyNameSelected.setAlignment(Align.LEFT);
	hMerchantCompanyNameSelected.setDefaultValue(null);
	hMerchantCompanyNameSelected.setIconResource(null);
	hMerchantCompanyNameSelected.setWidth(300);
	hMerchantCompanyNameSelected.setOrder(4);

	hMerchantUrlSelected.setColumnId("merchantUrl");
	hMerchantUrlSelected.setType(String.class);
	hMerchantUrlSelected.setAlignment(Align.LEFT);
	hMerchantUrlSelected.setDefaultValue(null);
	hMerchantUrlSelected.setIconResource(null);
	hMerchantUrlSelected.setOrder(5);

	hMerchantContactPersonSelected.setColumnId("merchantContactPerson");
	hMerchantContactPersonSelected.setType(String.class);
	hMerchantContactPersonSelected.setAlignment(Align.LEFT);
	hMerchantContactPersonSelected.setDefaultValue(null);
	hMerchantContactPersonSelected.setIconResource(null);
	hMerchantContactPersonSelected.setWidth(200);
	hMerchantContactPersonSelected.setOrder(6);

	hMerchantStatusSelected.setColumnId("merchantStatus");
	hMerchantStatusSelected.setType(String.class);
	hMerchantStatusSelected.setAlignment(Align.CENTER);
	hMerchantStatusSelected.setDefaultValue(null);
	hMerchantStatusSelected.setIconResource(null);
	hMerchantStatusSelected.setWidth(100);
	hMerchantStatusSelected.setOrder(7);

	hIdSelected.setColumnId("id");
	hIdSelected.setType(Long.class);
	hIdSelected.setVisible(false);
	hIdSelected.setOrder(8);

	List<TableHeaderProperty> headerSelectedProperties = new ArrayList<TableHeaderProperty>();
	headerSelectedProperties.add(hCommandSelected);
	headerSelectedProperties.add(hNoSelected);
	headerSelectedProperties.add(hMerchantIDSelected);
	headerSelectedProperties.add(hMerchantCompanyNameSelected);
	headerSelectedProperties.add(hMerchantUrlSelected);
	headerSelectedProperties.add(hMerchantContactPersonSelected);
	headerSelectedProperties.add(hMerchantStatusSelected);
	headerSelectedProperties.add(hIdSelected);

	tableMerchantSelectedPanel.setTableBeanContainerColumnHeader(headerSelectedProperties, SearchMerchantProfileTableItemBean.class);
	tableMerchantSelectedPanel.setRowIndexVisiblePageNumber();
	tableMerchantSelectedPanel.setTableSelect(false);
	tableMerchantSelectedPanel.setAllowSortRecord(false);
	tableMerchantSelectedPanel.setEnableTableSorting(false);
	tableMerchantSelectedPanel.setTableColumnReordering(false);
	tableMerchantSelectedPanel.createControlTablePageNumber();

	gridParentMerchantMemberLayout.addComponent(tableMerchantSelectedPanel, 0, 2);
	gridParentMerchantMemberLayout.setComponentAlignment(tableMerchantSelectedPanel, Alignment.TOP_CENTER);

	HorizontalLayout commandLayout = new HorizontalLayout();
	commandLayout.setSizeUndefined();
	commandLayout.setSpacing(true);
	commandLayout.setMargin(true);
	btnSave.addStyleName("button-blue");
	btnClear.addStyleName("button-green");
	btnCancel.addStyleName("button-red");
	btnSave.setDisableOnClick(true);
	btnClear.setDisableOnClick(true);
	btnCancel.setDisableOnClick(true);
	btnSave.setWidth("70px");
	btnClear.setWidth("70px");
	btnCancel.setWidth("70px");
	commandLayout.addComponent(btnSave);
	commandLayout.addComponent(btnClear);
	commandLayout.addComponent(btnCancel);
	gridParentMerchantPanelLayout.addComponent(commandLayout, 0, 2, 3, 2);
	gridParentMerchantPanelLayout.setComponentAlignment(commandLayout, Alignment.MIDDLE_CENTER);

	this.addComponent(this.createParentMerchantPanel);
	this.setComponentAlignment(this.createParentMerchantPanel, Alignment.TOP_CENTER);
    }

    @Override
    public void initListener() {
	this.createParentMerchantClearButtonClickListener.setBasedComponent(this);
	this.createParentMerchantSaveButtonClickListener.setBasedComponent(this);
	this.createParentMerchantCancelButtonClickListener.setBasedComponent(this);
	this.createParentMerchantSearchMerchantProfileTableAddButtonClickListener.setBasedComponent(this);
	this.createParentMerchantSelectedMerchantProfileTableRemoveButtonClickListener.setBasedComponent(this);
	this.createParentMerchantSearchMerchantProfileSearchButtonClickListener.setBasedComponent(this);
	this.createParentMerchantSearchMerchantProfileClearButtonClickListener.setBasedComponent(this);
	this.createParentMerchantSearchMerchantProfileTablePageButtonClickListener.setBasedComponent(this);
	this.createParentMerchantSearchMerchantProfileTableSizeValueChangeListener.setBasedComponent(this);
	this.createParentMerchantSelectedMerchantProfileTablePageButtonClickListener.setBasedComponent(this);
	this.createParentMerchantSelectedMerchantProfileTableSizeValueChangeListener.setBasedComponent(this);

	this.createParentMerchantClearButtonClickListener.setAutoEnabled(true);
	this.createParentMerchantSaveButtonClickListener.setAutoEnabled(true);
	this.createParentMerchantCancelButtonClickListener.setAutoEnabled(true);
	this.createParentMerchantSearchMerchantProfileTableAddButtonClickListener.setAutoEnabled(true);
	this.createParentMerchantSelectedMerchantProfileTableRemoveButtonClickListener.setAutoEnabled(true);
	this.createParentMerchantSearchMerchantProfileSearchButtonClickListener.setAutoEnabled(true);
	this.createParentMerchantSearchMerchantProfileClearButtonClickListener.setAutoEnabled(true);

	this.createParentMerchantSearchMerchantProfileTablePageButtonClickListener.setTablePanel(this.tableMerchantPanel);
	this.createParentMerchantSearchMerchantProfileTableSizeValueChangeListener.setTablePanel(this.tableMerchantPanel);
	this.tableMerchantPanel.addPageTableButtonClickListener(this.createParentMerchantSearchMerchantProfileTablePageButtonClickListener);
	this.tableMerchantPanel.addSizeTableValueChangeListener(this.createParentMerchantSearchMerchantProfileTableSizeValueChangeListener);

	this.createParentMerchantSelectedMerchantProfileTablePageButtonClickListener.setTablePanel(this.tableMerchantSelectedPanel);
	this.createParentMerchantSelectedMerchantProfileTableSizeValueChangeListener.setTablePanel(this.tableMerchantSelectedPanel);
	this.tableMerchantSelectedPanel
		.addPageTableButtonClickListener(this.createParentMerchantSelectedMerchantProfileTablePageButtonClickListener);
	this.tableMerchantSelectedPanel
		.addSizeTableValueChangeListener(this.createParentMerchantSelectedMerchantProfileTableSizeValueChangeListener);

	this.btnClear.addClickListener(this.createParentMerchantClearButtonClickListener);
	this.btnSave.addClickListener(this.createParentMerchantSaveButtonClickListener);
	this.btnCancel.addClickListener(this.createParentMerchantCancelButtonClickListener);
	this.btnMerchantSearch.addClickListener(this.createParentMerchantSearchMerchantProfileSearchButtonClickListener);
	this.btnMerchantClear.addClickListener(this.createParentMerchantSearchMerchantProfileClearButtonClickListener);

    }

    @Override
    public void initValidator() {

	this.txtParentMerchantID.setMaxLength(15);
	this.txtParentMerchantID.setImmediate(true);
	this.txtParentMerchantID.setRequired(true);
	this.txtParentMerchantID.setRequiredError(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.parentId.mandatory"));
	RegexpValidator parentIdRegexpValidator = new RegexpValidator("[A-Za-z0-9]*", true,
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.parentId.format"));
	StringLengthValidator parentIdStringLengthValidator = new StringLengthValidator(
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.parentId.length"),
		1, 15, false);
	this.txtParentMerchantID.addValidator(parentIdRegexpValidator);
	this.txtParentMerchantID.addValidator(parentIdStringLengthValidator);

	this.txtParentMerchantName.setMaxLength(100);
	this.txtParentMerchantName.setImmediate(true);
	this.txtParentMerchantName.setRequired(true);
	this.txtParentMerchantName.setRequiredError(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.parentName.mandatory"));
	RegexpValidator parentNameRegexpValidator = new RegexpValidator(
		FormValidatorService.PATTERN_NAME_EN,
		true,
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.parentName.format"));
	StringLengthValidator parentNameStringLengthValidator = new StringLengthValidator(
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.parentName.length"),
		1, 100, false);
	this.txtParentMerchantName.addValidator(parentNameRegexpValidator);
	this.txtParentMerchantName.addValidator(parentNameStringLengthValidator);

	this.txtBusinessAddress.setMaxLength(100);
	this.txtBusinessAddress.setImmediate(true);
	this.txtBusinessAddress.setRequired(true);
	this.txtBusinessAddress
		.setRequiredError(this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.businessAddress.mandatory"));
	RegexpValidator businessAddressRegexpValidator = new RegexpValidator(
		FormValidatorService.PATTERN_NAME_EN,
		true,
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.businessAddress.format"));
	StringLengthValidator businessAddressStringLengthValidator = new StringLengthValidator(
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.businessAddress.length"),
		1, 100, false);
	this.txtBusinessAddress.addValidator(businessAddressRegexpValidator);
	this.txtBusinessAddress.addValidator(businessAddressStringLengthValidator);

	this.cbbParentStatus.setImmediate(true);
	this.cbbParentStatus.setRequired(true);
	this.cbbParentStatus.setRequiredError(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.parentStatus.mandatory"));

	this.cbbTitle.setImmediate(true);
	this.cbbTitle.setRequired(true);
	this.cbbTitle.setRequiredError(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.title.mandatory"));

	this.txtFirstName.setMaxLength(100);
	this.txtFirstName.setImmediate(true);
	this.txtFirstName.setRequired(true);
	this.txtFirstName.setRequiredError(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.firstName.mandatory"));
	RegexpValidator firstNameRegexpValidator = new RegexpValidator(FormValidatorService.PATTERN_NAME, true,
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.firstName.format"));
	StringLengthValidator firstNameStringLengthValidator = new StringLengthValidator(
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.firstName.length"),
		1, 100, false);
	this.txtFirstName.addValidator(firstNameRegexpValidator);
	this.txtFirstName.addValidator(firstNameStringLengthValidator);

	this.txtLastName.setMaxLength(100);
	this.txtLastName.setImmediate(true);
	this.txtLastName.setRequired(true);
	this.txtLastName.setRequiredError(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.lastName.mandatory"));
	RegexpValidator lastNameRegexpValidator = new RegexpValidator(FormValidatorService.PATTERN_NAME, true,
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.lastName.format"));
	StringLengthValidator lastNameStringLengthValidator = new StringLengthValidator(
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.lastName.length"),
		1, 100, false);
	this.txtLastName.addValidator(lastNameRegexpValidator);
	this.txtLastName.addValidator(lastNameStringLengthValidator);

	this.txtTelephoneNumber.setMaxLength(40);
	this.txtTelephoneNumber.setImmediate(true);
	this.txtTelephoneNumber.setRequired(true);
	this.txtTelephoneNumber
		.setRequiredError(this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.telephoneNumber.mandatory"));
	RegexpValidator telephoneNumberRegexpValidator = new RegexpValidator(
		"[0-9-+]*",
		true,
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.telephoneNumber.format"));
	StringLengthValidator telephoneNumberStringLengthValidator = new StringLengthValidator(
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.telephoneNumber.length"),
		1, 40, true);
	this.txtTelephoneNumber.addValidator(telephoneNumberRegexpValidator);
	this.txtTelephoneNumber.addValidator(telephoneNumberStringLengthValidator);

	this.txtEmailAddress.setMaxLength(40);
	this.txtEmailAddress.setImmediate(true);
	this.txtEmailAddress.setRequired(true);
	this.txtEmailAddress.setRequiredError(this.messageBAO
		.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.emailAddress.mandatory"));
	RegexpValidator emailAddressValidator = new RegexpValidator(
		FormValidatorService.PATTERN_EMAIL,
		true,
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.emailAddress.format"));
	this.txtEmailAddress.addValidator(emailAddressValidator);
	StringLengthValidator emailStringLengthValidator = new StringLengthValidator(
		this.messageBAO
			.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.message.emailAddress.length"),
		1, 40, false);
	this.txtEmailAddress.addValidator(emailStringLengthValidator);

    }

    @SuppressWarnings("rawtypes")
    @Override
    public void initData() {
	try {

	    String statusDefault = this.propertyBAO
		    .getPropertyValue("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.default.status.item");
	    String statusInclude = this.propertyBAO
		    .getPropertyValue("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.include.status.item");
	    String statusIncludeCaption = this.messageBAO
		    .getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.include.status.item.caption");
	    if (statusInclude != null) {
		String[] statusIncludeArr = statusInclude.split(",");
		String[] statusIncludeCaptionArr = statusIncludeCaption.split(",");
		if (statusIncludeArr != null) {
		    for (int loop = 0; loop < statusIncludeArr.length; loop++) {
			this.cbbMerchantStatus.addItem(statusIncludeArr[loop]);
			this.cbbMerchantStatus.setItemCaption(statusIncludeArr[loop], statusIncludeCaptionArr[loop]);
		    }
		}
	    }

	    List<EntryBean<String, String>> masterData = this.masterDataBAO.selectAllMerchantProfileStatus();
	    if (masterData != null) {
		for (EntryBean<String, String> entry : masterData) {
		    this.merchantStatusMap.put(entry.getKey(), entry.getValue());
		    this.cbbMerchantStatus.addItem(entry.getKey());
		    this.cbbMerchantStatus.setItemCaption(entry.getKey(), entry.getValue());
		}
	    }
	    this.cbbMerchantStatus.select(statusDefault);
	    this.cbbMerchantStatus.setValue(statusDefault);

	    List<String> excludeStatus = Arrays
		    .asList(new String[] {
			    propertyBAO
				    .getPropertyValue("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.exclude.parentStatus.item.inactive"),
			    propertyBAO
				    .getPropertyValue("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.exclude.parentStatus.item.closed") });
	    masterData = this.masterDataBAO.selectAllParentMerchantStatus();
	    if (masterData != null) {
		for (EntryBean<String, String> entry : masterData) {
		    if (!excludeStatus.contains(entry.getKey())) {
			this.cbbParentStatus.addItem(entry.getKey());
			this.cbbParentStatus.setItemCaption(entry.getKey(), entry.getValue());
		    }
		}
	    }

	    masterData = this.masterDataBAO.selectAllTitleName();
	    if (masterData != null) {
		for (EntryBean<String, String> entry : masterData) {
		    this.cbbTitle.addItem(entry.getKey());
		    this.cbbTitle.setItemCaption(entry.getKey(), entry.getValue());
		}
	    }

	    String sortingDefault = this.propertyBAO
		    .getPropertyValue("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.default.table.sorting");
	    searchCriteriaBean.setDirection1(SearchCriteriaBean.DIRECTION_ASC);
	    searchCriteriaBean.setOrder1(sortingDefault);
	    SearchMerchantProfileBean searchMerchantProfileBean = new SearchMerchantProfileBean();
	    searchMerchantProfileBean.setSearchAllStatus(Boolean.TRUE);
	    searchCriteriaBean.setCriteriaBean(searchMerchantProfileBean);
	    searchCriteriaBean.setPage(1);
	    searchCriteriaBean.setSize(30);
	    SearchResultBean<MerchantProfileBean> searchResultBean = merchantProfileBAO.selectMerchantProfile(searchCriteriaBean);

	    Integer totalPage = searchResultBean.getTotalPages();
	    if (totalPage == null) {
		totalPage = 1;
	    }
	    Long totalElement = searchResultBean.getTotalElements();
	    if (totalElement == null) {
		totalElement = 0l;
	    }
	    List<BeanItem> beanItems = this.generateTableItemBean(searchResultBean);

	    this.tableMerchantPanel.clearTableData();
	    this.tableMerchantPanel.setManualPageTable(1);
	    this.tableMerchantPanel.setTableBeanContainerDataTotalPage(beanItems, totalPage, totalElement);

	} catch (Exception e) {
	    e.printStackTrace();
	}
    }

    @SuppressWarnings("rawtypes")
    public List<BeanItem> generateTableItemBean(SearchResultBean<MerchantProfileBean> searchResultBean) {
	List<BeanItem> beanItems = new ArrayList<BeanItem>();
	if (searchResultBean != null && searchResultBean.getContent() != null) {

	    this.tableAddButtons.clear();

	    for (int loop = 0; loop < searchResultBean.getContent().size(); loop++) {
		MerchantProfileBean merchantProfileBean = searchResultBean.getContent().get(loop);
		SearchMerchantProfileTableItemBean searchMerchantProfileTableItemBean = new SearchMerchantProfileTableItemBean();

		searchMerchantProfileTableItemBean.setId(merchantProfileBean.getId());
		searchMerchantProfileTableItemBean.setMerchantID(merchantProfileBean.getMerchantId());
		searchMerchantProfileTableItemBean.setMerchantCompnayName(merchantProfileBean.getCompanyNameEn());
		searchMerchantProfileTableItemBean.setMerchantUrl(merchantProfileBean.getUrl());
		searchMerchantProfileTableItemBean.setMerchantContactPerson(merchantProfileBean.getContact1Name());

		String statusText = this.merchantStatusMap.get(merchantProfileBean.getMerchantStatus());
		if (statusText == null) {
		    statusText = merchantProfileBean.getMerchantStatus();
		}
		searchMerchantProfileTableItemBean.setMerchantStatus(statusText);

		HorizontalLayout hLayout = new HorizontalLayout();
		Button btnAdd = new Button(
			this.messageBAO
				.getMessage("com.fw.ui.view.settings.usercontrol.parentmerchant.CreateParentMerchantView.button.table.add"));

		btnAdd.setData(searchMerchantProfileTableItemBean);
		btnAdd.addClickListener(this.createParentMerchantSearchMerchantProfileTableAddButtonClickListener);
		btnAdd.setDisableOnClick(true);

		btnAdd.addStyleName("button-blue-small");

		tableAddButtons.add(btnAdd);

		hLayout.addComponent(btnAdd);

		searchMerchantProfileTableItemBean.setCommandLayout(hLayout);

		beanItems.add(new BeanItem<SearchMerchantProfileTableItemBean>(searchMerchantProfileTableItemBean));
	    }
	}
	return beanItems;
    }

    public VaadinApplicationObjectSupport getApp() {
	return app;
    }

    public MasterDataBAO getMasterDataBAO() {
	return masterDataBAO;
    }

    public PropertyBAO getPropertyBAO() {
	return propertyBAO;
    }

    public MessageBAO getMessageBAO() {
	return messageBAO;
    }

    public MerchantProfileBAO getMerchantProfileBAO() {
	return merchantProfileBAO;
    }

    public ParentMerchantBAO getParentMerchantBAO() {
	return parentMerchantBAO;
    }

    public Map<String, String> getMerchantStatusMap() {
	return merchantStatusMap;
    }

    public ParentMerchantBean getParentMerchantBean() {
	return parentMerchantBean;
    }

    public SearchCriteriaBean<SearchMerchantProfileBean> getSearchCriteriaBean() {
	return searchCriteriaBean;
    }

    public CreateParentMerchantSearchMerchantProfileSearchButtonClickListener getCreateParentMerchantSearchMerchantProfileSearchButtonClickListener() {
	return createParentMerchantSearchMerchantProfileSearchButtonClickListener;
    }

    public CreateParentMerchantSearchMerchantProfileClearButtonClickListener getCreateParentMerchantSearchMerchantProfileClearButtonClickListener() {
	return createParentMerchantSearchMerchantProfileClearButtonClickListener;
    }

    public CreateParentMerchantSearchMerchantProfileTableAddButtonClickListener getCreateParentMerchantSearchMerchantProfileTableAddButtonClickListener() {
	return createParentMerchantSearchMerchantProfileTableAddButtonClickListener;
    }

    public CreateParentMerchantSelectedMerchantProfileTableRemoveButtonClickListener getCreateParentMerchantSelectedMerchantProfileTableRemoveButtonClickListener() {
	return createParentMerchantSelectedMerchantProfileTableRemoveButtonClickListener;
    }

    public CreateParentMerchantSearchMerchantProfileTablePageButtonClickListener getCreateParentMerchantSearchMerchantProfileTablePageButtonClickListener() {
	return createParentMerchantSearchMerchantProfileTablePageButtonClickListener;
    }

    public CreateParentMerchantSearchMerchantProfileTableSizeValueChangeListener getCreateParentMerchantSearchMerchantProfileTableSizeValueChangeListener() {
	return createParentMerchantSearchMerchantProfileTableSizeValueChangeListener;
    }

    public CreateParentMerchantClearButtonClickListener getCreateParentMerchantClearButtonClickListener() {
	return createParentMerchantClearButtonClickListener;
    }

    public CreateParentMerchantSaveButtonClickListener getCreateParentMerchantSaveButtonClickListener() {
	return createParentMerchantSaveButtonClickListener;
    }

    public CreateParentMerchantCancelButtonClickListener getCreateParentMerchantCancelButtonClickListener() {
	return createParentMerchantCancelButtonClickListener;
    }

    public Panel getCreateParentMerchantPanel() {
	return createParentMerchantPanel;
    }

    public Panel getCreateParentMerchantProfilePanel() {
	return createParentMerchantProfilePanel;
    }

    public Panel getCreateParentMerchantContactPersonPanel() {
	return createParentMerchantContactPersonPanel;
    }

    public Panel getCreateMerchantMemberPanel() {
	return createMerchantMemberPanel;
    }

    public GridLayout getGridParentMerchantPanelLayout() {
	return gridParentMerchantPanelLayout;
    }

    public GridLayout getGridParentMerchantProfileLayout() {
	return gridParentMerchantProfileLayout;
    }

    public GridLayout getGridParentMerchantContactPersonLayout() {
	return gridParentMerchantContactPersonLayout;
    }

    public GridLayout getGridParentMerchantMemberLayout() {
	return gridParentMerchantMemberLayout;
    }

    public GridLayout getGridParentMerchantSearchLayout() {
	return gridParentMerchantSearchLayout;
    }

    public Label getLblParentMerchantID() {
	return lblParentMerchantID;
    }

    public Label getLblParentMerchantName() {
	return lblParentMerchantName;
    }

    public Label getLblBusinessAddress() {
	return lblBusinessAddress;
    }

    public Label getLblParentStatus() {
	return lblParentStatus;
    }

    public Label getLblTitle() {
	return lblTitle;
    }

    public Label getLblFirstName() {
	return lblFirstName;
    }

    public Label getLblLastName() {
	return lblLastName;
    }

    public Label getLblTelephoneNumber() {
	return lblTelephoneNumber;
    }

    public Label getLblEmailAddress() {
	return lblEmailAddress;
    }

    public TextField getTxtParentMerchantID() {
	return txtParentMerchantID;
    }

    public TextField getTxtParentMerchantName() {
	return txtParentMerchantName;
    }

    public TextArea getTxtBusinessAddress() {
	return txtBusinessAddress;
    }

    public ComboBox getCbbParentStatus() {
	return cbbParentStatus;
    }

    public ComboBox getCbbTitle() {
	return cbbTitle;
    }

    public TextField getTxtFirstName() {
	return txtFirstName;
    }

    public TextField getTxtLastName() {
	return txtLastName;
    }

    public TextField getTxtTelephoneNumber() {
	return txtTelephoneNumber;
    }

    public TextField getTxtEmailAddress() {
	return txtEmailAddress;
    }

    public Label getLblParentMerchantIDValidateMessage() {
	return lblParentMerchantIDValidateMessage;
    }

    public Label getLblParentMerchantNameValidateMessage() {
	return lblParentMerchantNameValidateMessage;
    }

    public Label getLblBusinessAddressValidateMessage() {
	return lblBusinessAddressValidateMessage;
    }

    public Label getLblParentStatusValidateMessage() {
	return lblParentStatusValidateMessage;
    }

    public Label getLblTitleValidateMessage() {
	return lblTitleValidateMessage;
    }

    public Label getLblFirstNameValidateMessage() {
	return lblFirstNameValidateMessage;
    }

    public Label getLblLastNameValidateMessage() {
	return lblLastNameValidateMessage;
    }

    public Label getLblTelephoneNumberValidateMessage() {
	return lblTelephoneNumberValidateMessage;
    }

    public Label getLblEmailAddressValidateMessage() {
	return lblEmailAddressValidateMessage;
    }

    public Label getLblMerchantID() {
	return lblMerchantID;
    }

    public Label getLblMerchantCompanyName() {
	return lblMerchantCompanyName;
    }

    public Label getLblMerchantUrl() {
	return lblMerchantUrl;
    }

    public Label getLblMerchantContactPerson() {
	return lblMerchantContactPerson;
    }

    public Label getLblMerchantStatus() {
	return lblMerchantStatus;
    }

    public TextField getTxtMerchantID() {
	return txtMerchantID;
    }

    public TextField getTxtMerchantCompanyName() {
	return txtMerchantCompanyName;
    }

    public TextField getTxtMerchantUrl() {
	return txtMerchantUrl;
    }

    public TextField getTxtMerchantContactPerson() {
	return txtMerchantContactPerson;
    }

    public ComboBox getCbbMerchantStatus() {
	return cbbMerchantStatus;
    }

    public Button getBtnMerchantSearch() {
	return btnMerchantSearch;
    }

    public Button getBtnMerchantClear() {
	return btnMerchantClear;
    }

    public TablePanel getTableMerchantPanel() {
	return tableMerchantPanel;
    }

    public TableHeaderProperty gethCommand() {
	return hCommand;
    }

    public TableHeaderProperty gethNo() {
	return hNo;
    }

    public TableHeaderProperty gethMerchantID() {
	return hMerchantID;
    }

    public TableHeaderProperty gethMerchantCompanyName() {
	return hMerchantCompanyName;
    }

    public TableHeaderProperty gethMerchantUrl() {
	return hMerchantUrl;
    }

    public TableHeaderProperty gethMerchantContactPerson() {
	return hMerchantContactPerson;
    }

    public TableHeaderProperty gethMerchantStatus() {
	return hMerchantStatus;
    }

    public TableHeaderProperty gethId() {
	return hId;
    }

    public TablePanel getTableMerchantSelectedPanel() {
	return tableMerchantSelectedPanel;
    }

    public TableHeaderProperty gethCommandSelected() {
	return hCommandSelected;
    }

    public TableHeaderProperty gethNoSelected() {
	return hNoSelected;
    }

    public TableHeaderProperty gethMerchantIDSelected() {
	return hMerchantIDSelected;
    }

    public TableHeaderProperty gethMerchantCompanyNameSelected() {
	return hMerchantCompanyNameSelected;
    }

    public TableHeaderProperty gethMerchantUrlSelected() {
	return hMerchantUrlSelected;
    }

    public TableHeaderProperty gethMerchantContactPersonSelected() {
	return hMerchantContactPersonSelected;
    }

    public TableHeaderProperty gethMerchantStatusSelected() {
	return hMerchantStatusSelected;
    }

    public TableHeaderProperty gethIdSelected() {
	return hIdSelected;
    }

    public Button getBtnSave() {
	return btnSave;
    }

    public Button getBtnClear() {
	return btnClear;
    }

    public Button getBtnCancel() {
	return btnCancel;
    }

    public List<Button> getTableAddButtons() {
	return tableAddButtons;
    }

    public List<Button> getTableRemoveButtons() {
	return tableRemoveButtons;
    }

    @SuppressWarnings("rawtypes")
    public Map<Long, BeanItem> getSelectedBeanItemMap() {
	return selectedBeanItemMap;
    }

}
